package ejbPart.entity.bankAccount;

import exceptions.AccountException;
import javax.ejb.CreateException;
import javax.ejb.EJBLocalHome;
import javax.ejb.FinderException;
import java.util.Collection;

public interface AccountLocalHome extends EJBLocalHome {

    /**
     * Create new record into the database.
     */
    public AccountLocal create(String accountId, String ownerName) throws CreateException;

    /**
     * Finds account by it primary key.
     */
    public AccountLocal findByPrimaryKey(AccountPK key) throws FinderException;

    public Collection findByOwnerName(String name) throws FinderException;

    /**
     * Calculates the total bank balance.
     */
    public double getTotalBankValue() throws AccountException;
}
